<?php

$this->menu=array(
	array('label'=>'List MemberModel', 'url'=>array('index')),
	array('label'=>'Create MemberModel', 'url'=>array('admin/create/?model=contact')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('member-model-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Manage Member</h1>



<?php echo CHtml::submitButton('Advanced Search',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php 
        $this->renderPartial('member/_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'member-model-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'level',
		'company_name',
		'show_company',
		'first_name',
		'middle_name',
		'last_name',
		'email',
		'password',
		'address',
		'city',
		'state',
		'zip_code',
		'country',
		'phone_number',
		'active',
		
		array(
        'class'=>'CButtonColumn',
        'viewButtonUrl'=>'Yii::app()->createUrl("/admin/view", array("id" => $data["id"],"model" => "member"))',
        'deleteButtonUrl'=>'Yii::app()->createUrl("/admin/delete", array("id" =>  $data["id"],"model" => "member"))',
        'updateButtonUrl'=>'Yii::app()->createUrl("/admin/update", array("id" =>  $data["id"],"model" => "member"))',
    ),
	),
)); ?>
